package com.ybg.bookrules.module.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.lang.ref.PhantomReference;
import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("userinfos")
public class Userinfos {
    @TableId( type = IdType.AUTO)
    private Integer userid;
    private int roleid;
    private String username;
    private String password;
    private String realname;
    private int gender;
    private String carid;
    private String address;
    private String telephone;

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return  userid +
                "," + roleid +
                "," + username +
                "," + realname +
                "," + gender +
                "," + carid +
                "," + address +
                "," + telephone +
                "," + sdf.format(registertime)
                ;
    }

    private Date registertime;
    @TableLogic
    private int deleted;
}
